package java8.date;

import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.ChronoUnit;

public class LocalDateDemo {
    public static void main(String[] args) {
        //今天，日期格式
        LocalDate today = LocalDate.now();
        System.out.println(today);
        //明天，增加一天
        LocalDate tomorrow = today.plus(1, ChronoUnit.DAYS);
        //后天，增加两天
        System.out.println(today.plusDays(2));
        //昨天，减少一天
        System.out.println(today.minusDays(1));

        //某一天
        LocalDate someday = LocalDate.of(2018, Month.JULY, 4);
        System.out.println(someday);
        //星期几
        System.out.println(someday.getDayOfWeek());
        //一年中的第几天
        System.out.println(someday.getDayOfYear());
        //一个月中的第几天
        System.out.println(someday.getDayOfMonth());


//        DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)


    }
}
